package homework;
class Circle {
    // 定义常量
    public static final double PI = 3.14159;
    private double R;
    // 构造函数
    public Circle(double r) {
        this.R = r;
    }
    // 获取半径
    public double getR() {
        return R;
    }
    // 计算面积
    public double Area() {
        return PI * R * R;
    }
    // 计算周长
    public double Circumference() {
        return 2 * PI * R;
    }
}
public class yuan {
    public static void main(String[] args) {
        // 创建Circle对象
        Circle circle = new Circle(10.5);
        // 输出半径、面积和周长
        System.out.println("半径：" + circle.getR());
        System.out.println("面积：" + circle.Area());
        System.out.println("周长：" + circle.Circumference());
    }
}
